class Solution:
    def bestTeamScore(self, scores: list[int], ages: list[int]) -> int:
        arr = list(sorted(zip(ages, scores)))
        dp = [a[1] for a in arr]
        for i in range(len(arr)):
            for j in range(i):
                if arr[i][1] >= arr[j][1]:
                    dp[i] = max(dp[i], dp[j] + arr[i][1])
        return max(dp)


so = Solution.bestTeamScore('hello', list(
    [1, 3, 5, 10, 15]), list([1, 2, 3, 4, 5]))
print(so)
